/*
 * Copyright 2012-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.web.embedded.jetty;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.ThreadPool;

import org.springframework.boot.web.server.ConfigurableWebServerFactory;

/**
 * 用于Jetty特定功能的{@link ConfigurableWebServerFactory}。
 * @author Brian Clozel
 * @since 2.0.0
 * @see JettyServletWebServerFactory
 * @see JettyReactiveWebServerFactory
 */
public interface ConfigurableJettyWebServerFactory extends ConfigurableWebServerFactory {

	/**
	 * 设置要使用的接受器线程数。
	 * @param acceptors 要使用的接受器线程数
	 */
	void setAcceptors(int acceptors);

	/**
	 * 设置{@link Server}应该使用的{@link ThreadPool}。如果设置为{@code null}（默认值），
	 * {@link Server}会隐式创建一个{@link ThreadPool}。
	 * @param threadPool 要使用的ThreadPool
	 */
	void setThreadPool(ThreadPool threadPool);

	/**
	 * 设置要使用的选择器线程数。
	 * @param selectors 要使用的选择器线程数
	 */
	void setSelectors(int selectors);

	/**
	 * 设置是否应该处理x-forward-头部。
	 * @param useForwardHeaders 是否应该使用x-forward头部
	 */
	void setUseForwardHeaders(boolean useForwardHeaders);

	/**
	 * 添加将在{@link Server}启动之前应用到它的{@link JettyServerCustomizer}。
	 * @param customizers 要添加的自定义器
	 */
	void addServerCustomizers(JettyServerCustomizer... customizers);

}
